Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
postcss-discard
Advanced tools
PostCSS plugin to discard rules, atrules or declarations by selector, RegExp or callback function
PostCSS plugin to discard rules by selector, RegExp, or @type. Also usable to generate a diff from two stylesheets
const discard = require('postcss-discard');
postcss([discard(options)]);
See PostCSS docs for examples for your environment.
Name | Type | Description |
---|---|---|
atrule | String , RegExp , Function | Match atrule like @font-face |
rule | String , RegExp , Function | Match rule like .big-background-image {...} |
decl | String , RegExp , Function | Match declarations |
css | String | CSS String or path to file containing css |
You can also pass a filter function for any of the supported types. The function is invoked with two arguments (node, value).
node
The currently processed AST node generated by postcss
.value
Current value.Return true if the element should be discarded.
postcss(discard({css: 'STYLES TO BE REMOVED'})).process('ORIGINAL CSS').css;
.bg {
width: 100%;
height: 100%;
background-image: url('some/big/image.png');
}
@font-face {
font-family: 'My awesome font';
}
@media print {
...;
}
postcss([
discard({
atrule: ['@font-face', /print/],
}),
]);
.bg {
width: 100%;
height: 100%;
}
FAQs
PostCSS plugin to discard rules, atrules or declarations by selector, RegExp or callback function
The npm package postcss-discard receives a total of 22,682 weekly downloads. As such, postcss-discard popularity was classified as popular.
We found that postcss-discard demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.